package ryarithsGame;

import com.jme.math.Vector2f;
import com.jme.math.Vector3f;
import com.jme.scene.Node;

public class Level6 extends Node 
{

	private PuzzleNode[] puzzle;
	private Goal goal;
	private static final long serialVersionUID = 1L;

	public Level6()
	{
		super("Level6");
		loadPuzzle();
	}
	
	private void loadPuzzle()
	{
		
		goal = new Goal("goal", new Vector3f(425,15,475));
		puzzle = new PuzzleNode[144];
		loadPuzzleMaze();
		this.attachChild(goal);
	}
	
	public void updateLevel(float tpf)
	{
		for(int i = 0; i < puzzle.length; i++)
		{
			puzzle[i].updatePuzzleNode(tpf);
		}
		goal.updateGoalNode();	
	}
	
	public void checkSwitchCollisions(Vector2f camPos)
	{
		goal.checkSwitchCollisions(camPos);
	}
	
	public boolean getGoalSwitch()
	{
		return goal.getIsSwitched();
	}
	
	public PuzzleNode getPuzzleNode(int i)
	{
		return puzzle[i];
	}
	
	public int puzzleSize()
	{
		return puzzle.length;
	}
	
	
	private void loadPuzzleMaze()
	{


		puzzle[0] = new PuzzleNode("switch0", 1, new Vector3f(25,10,25),new Vector3f(25,10,25)); //*
		puzzle[1] = new PuzzleNode("switch1", 1, new Vector3f(25,10,75),new Vector3f(25,10,75)); //*
		puzzle[2] = new PuzzleNode("switch2", 0, new Vector3f(25,10,125),new Vector3f(25,10,125));
		puzzle[3] = new PuzzleNode("switch3", 0, new Vector3f(25,10,175),new Vector3f(25,10,175));
		puzzle[4] = new PuzzleNode("switch4", 0, new Vector3f(25,10,225),new Vector3f(25,10,225));
		puzzle[5] = new PuzzleNode("switch5", 0, new Vector3f(25,10,275),new Vector3f(25,10,275));
		puzzle[6] = new PuzzleNode("switch6", 0, new Vector3f(25,10,325),new Vector3f(25,10,325));
		puzzle[7] = new PuzzleNode("switch7", 0, new Vector3f(25,10,375),new Vector3f(25,10,375));
		puzzle[8] = new PuzzleNode("switch8", 0, new Vector3f(25,10,425),new Vector3f(25,10,425));
		puzzle[9] = new PuzzleNode("switch9", 0, new Vector3f(25,10,475),new Vector3f(25,10,475));
		puzzle[10] = new PuzzleNode("switch10", 0, new Vector3f(25,10,525),new Vector3f(25,10,525));
		puzzle[11] = new PuzzleNode("switch11", 0, new Vector3f(25,10,575),new Vector3f(25,10,575));

		puzzle[12] = new PuzzleNode("switsdch1", 1, new Vector3f(75,10,25),new Vector3f(75,10,25)); //*
		puzzle[13] = new PuzzleNode("switsdch1", 1, new Vector3f(75,10,75),new Vector3f(75,10,75)); //*
		puzzle[14] = new PuzzleNode("switsdch2", 0, new Vector3f(75,10,125),new Vector3f(75,10,125));
		puzzle[15] = new PuzzleNode("switsfch3", 1, new Vector3f(75,10,175),new Vector3f(75,10,175));
		puzzle[16] = new PuzzleNode("switwech4", 1, new Vector3f(75,10,225),new Vector3f(75,10,225));
		puzzle[17] = new PuzzleNode("switchw5", 1, new Vector3f(75,10,275),new Vector3f(75,10,275));
		puzzle[18] = new PuzzleNode("swwitch6", 1, new Vector3f(75,10,325),new Vector3f(75,10,325));
		puzzle[19] = new PuzzleNode("sweritch7", 1, new Vector3f(75,10,375),new Vector3f(75,10,375));
		puzzle[20] = new PuzzleNode("switwech8", 1, new Vector3f(75,10,425),new Vector3f(75,10,425));
		puzzle[21] = new PuzzleNode("switchw9", 1, new Vector3f(75,10,475),new Vector3f(75,10,475));
		puzzle[22] = new PuzzleNode("switch1q0", 1, new Vector3f(75,10,525),new Vector3f(75,10,525));
		puzzle[23] = new PuzzleNode("switch1we1", 0, new Vector3f(75,10,575),new Vector3f(75,10,575));

		puzzle[24] = new PuzzleNode("switchnt0", 0, new Vector3f(125,10,25),new Vector3f(125,10,25));
		puzzle[25] = new PuzzleNode("sgwitch1", 1, new Vector3f(125,10,75),new Vector3f(125,10,75));
		puzzle[26] = new PuzzleNode("swnhitch2", 0, new Vector3f(125,10,125),new Vector3f(125,10,125));
		puzzle[27] = new PuzzleNode("swittch3", 1, new Vector3f(125,10,175),new Vector3f(125,10,175));
		puzzle[28] = new PuzzleNode("switcdh4", 1, new Vector3f(125,10,225),new Vector3f(125,10,225));
		puzzle[29] = new PuzzleNode("switchn5", 1, new Vector3f(125,10,275),new Vector3f(125,10,275));
		puzzle[30] = new PuzzleNode("sw7itch6", 1, new Vector3f(125,10,325),new Vector3f(125,10,325));
		puzzle[31] = new PuzzleNode("swiutch7", 1, new Vector3f(125,10,375),new Vector3f(125,10,375));
		puzzle[32] = new PuzzleNode("swittch8", 1, new Vector3f(125,10,425),new Vector3f(125,10,425));
		puzzle[33] = new PuzzleNode("switcjh9", 1, new Vector3f(125,10,475),new Vector3f(125,10,475));
		puzzle[34] = new PuzzleNode("switchtw10", 1, new Vector3f(125,10,525),new Vector3f(125,10,525));
		puzzle[35] = new PuzzleNode("switcsh11", 0, new Vector3f(125,10,575),new Vector3f(125,10,575));

		puzzle[36] = new PuzzleNode("switch80", 0, new Vector3f(175,10,25),new Vector3f(175,10,25));
		puzzle[37] = new PuzzleNode("sw8itch1", 1, new Vector3f(175,10,75),new Vector3f(175,10,75));
		puzzle[38] = new PuzzleNode("s8witch2", 1, new Vector3f(175,10,125),new Vector3f(175,10,125));
		puzzle[39] = new PuzzleNode("swi8tch3", 1, new Vector3f(175,10,175),new Vector3f(175,10,175));
		puzzle[40] = new PuzzleNode("swit8ch4", 0, new Vector3f(175,10,225),new Vector3f(175,10,225));
		puzzle[41] = new PuzzleNode("switc8h5", 1, new Vector3f(175,10,275),new Vector3f(175,10,275));
		puzzle[42] = new PuzzleNode("s7witch6", 1, new Vector3f(175,10,325),new Vector3f(175,10,325));
		puzzle[43] = new PuzzleNode("sw76itch7", 1, new Vector3f(175,10,375),new Vector3f(175,10,375));
		puzzle[44] = new PuzzleNode("swit5ch8", 1, new Vector3f(175,10,425),new Vector3f(175,10,425));
		puzzle[45] = new PuzzleNode("switc4h9", 0, new Vector3f(175,10,475),new Vector3f(175,10,475));
		puzzle[46] = new PuzzleNode("switch310", 0, new Vector3f(175,10,525),new Vector3f(175,10,525));
		puzzle[47] = new PuzzleNode("switch131", 1, new Vector3f(175,10,575),new Vector3f(175,10,575));

		puzzle[48] = new PuzzleNode("sqwitch0", 0, new Vector3f(225,10,25),new Vector3f(225,10,25));
		puzzle[49] = new PuzzleNode("swqitch1", 0, new Vector3f(225,10,75),new Vector3f(225,10,75));
		puzzle[50] = new PuzzleNode("swiqtch2", 0, new Vector3f(225,10,125),new Vector3f(225,10,125));
		puzzle[51] = new PuzzleNode("switqch3", 0, new Vector3f(225,10,175),new Vector3f(225,10,175));
		puzzle[52] = new PuzzleNode("switcqqh4", 0, new Vector3f(225,10,225),new Vector3f(225,10,225));
		puzzle[53] = new PuzzleNode("sqwitch5", 1, new Vector3f(225,10,275),new Vector3f(225,10,275));
		puzzle[54] = new PuzzleNode("swqitch6", 0, new Vector3f(225,10,325),new Vector3f(225,10,325));
		puzzle[55] = new PuzzleNode("swiqtch7", 0, new Vector3f(225,10,375),new Vector3f(225,10,375));
		puzzle[56] = new PuzzleNode("switqch8", 1, new Vector3f(225,10,425),new Vector3f(225,10,425));
		puzzle[57] = new PuzzleNode("switcqh9", 1, new Vector3f(225,10,475),new Vector3f(225,10,475));
		puzzle[58] = new PuzzleNode("switchq10", 1, new Vector3f(225,10,525),new Vector3f(225,10,525));
		puzzle[59] = new PuzzleNode("switch1q1", 1, new Vector3f(225,10,575),new Vector3f(225,10,575));

		puzzle[60] = new PuzzleNode("sawitch0", 1, new Vector3f(275,10,25),new Vector3f(275,10,25));
		puzzle[61] = new PuzzleNode("swaitch1", 1, new Vector3f(275,10,75),new Vector3f(275,10,75));
		puzzle[62] = new PuzzleNode("swiatch2", 1, new Vector3f(275,10,125),new Vector3f(275,10,125));
		puzzle[63] = new PuzzleNode("switach3", 1, new Vector3f(275,10,175),new Vector3f(275,10,175));
		puzzle[64] = new PuzzleNode("switcah4", 1, new Vector3f(275,10,225),new Vector3f(275,10,225));
		puzzle[65] = new PuzzleNode("switcha5", 1, new Vector3f(275,10,275),new Vector3f(275,10,275));
		puzzle[66] = new PuzzleNode("swiatch6", 0, new Vector3f(275,10,325),new Vector3f(275,10,325));
		puzzle[67] = new PuzzleNode("switach7", 0, new Vector3f(275,10,375),new Vector3f(275,10,375));
		puzzle[68] = new PuzzleNode("switcah8", 0, new Vector3f(275,10,425),new Vector3f(275,10,425));
		puzzle[69] = new PuzzleNode("switcha9", 0, new Vector3f(275,10,475),new Vector3f(275,10,475));
		puzzle[70] = new PuzzleNode("swiatch10", 0, new Vector3f(275,10,525),new Vector3f(275,10,525));
		puzzle[71] = new PuzzleNode("switach11", 0, new Vector3f(275,10,575),new Vector3f(275,10,575));

		puzzle[72] = new PuzzleNode("switczh0", 1, new Vector3f(325,10,25),new Vector3f(325,10,25));
		puzzle[73] = new PuzzleNode("switchz1", 0, new Vector3f(325,10,75),new Vector3f(325,10,75));
		puzzle[74] = new PuzzleNode("szwitch2", 0, new Vector3f(325,10,125),new Vector3f(325,10,125));
		puzzle[75] = new PuzzleNode("swzitch3", 0, new Vector3f(325,10,175),new Vector3f(325,10,175));
		puzzle[76] = new PuzzleNode("swiztch4", 0, new Vector3f(325,10,225),new Vector3f(325,10,225));
		puzzle[77] = new PuzzleNode("switzch5", 0, new Vector3f(325,10,275),new Vector3f(325,10,275));
		puzzle[78] = new PuzzleNode("switczh6", 0, new Vector3f(325,10,325),new Vector3f(325,10,325));
		puzzle[79] = new PuzzleNode("switchz7", 1, new Vector3f(325,10,375),new Vector3f(325,10,375));
		puzzle[80] = new PuzzleNode("swxitch8", 1, new Vector3f(325,10,425),new Vector3f(325,10,425));
		puzzle[81] = new PuzzleNode("swixtch9", 1, new Vector3f(325,10,475),new Vector3f(325,10,475));
		puzzle[82] = new PuzzleNode("switxch10", 1, new Vector3f(325,10,525),new Vector3f(325,10,525));
		puzzle[83] = new PuzzleNode("switcxh11", 1, new Vector3f(325,10,575),new Vector3f(325,10,575));

		puzzle[84] = new PuzzleNode("suwitch0", 1, new Vector3f(375,10,25),new Vector3f(375,10,25));
		puzzle[85] = new PuzzleNode("swuitch1", 0, new Vector3f(375,10,75),new Vector3f(375,10,75));
		puzzle[86] = new PuzzleNode("swiutch2", 1, new Vector3f(375,10,125),new Vector3f(375,10,125));
		puzzle[87] = new PuzzleNode("swituch3", 1, new Vector3f(375,10,175),new Vector3f(375,10,175));
		puzzle[88] = new PuzzleNode("switcuuh4", 1, new Vector3f(375,10,225),new Vector3f(375,10,225));
		puzzle[89] = new PuzzleNode("switch5u", 1, new Vector3f(375,10,275),new Vector3f(375,10,275));
		puzzle[90] = new PuzzleNode("uswitch6", 0, new Vector3f(375,10,325),new Vector3f(375,10,325));
		puzzle[91] = new PuzzleNode("suwitch7", 1, new Vector3f(375,10,375),new Vector3f(375,10,375));
		puzzle[92] = new PuzzleNode("swuitch8", 0, new Vector3f(375,10,425),new Vector3f(375,10,425));
		puzzle[93] = new PuzzleNode("swiutch9", 0, new Vector3f(375,10,475),new Vector3f(375,10,475));
		puzzle[94] = new PuzzleNode("swituch10", 0, new Vector3f(375,10,525),new Vector3f(375,10,525));
		puzzle[95] = new PuzzleNode("switcuh11", 1, new Vector3f(375,10,575),new Vector3f(375,10,575));

		puzzle[96] = new PuzzleNode("pswitch0", 1, new Vector3f(425,10,25),new Vector3f(425,10,25));
		puzzle[97] = new PuzzleNode("spwitch1", 0, new Vector3f(425,10,75),new Vector3f(425,10,75));
		puzzle[98] = new PuzzleNode("swpitch2", 1, new Vector3f(425,10,125),new Vector3f(425,10,125));
		puzzle[99] = new PuzzleNode("swiptch3", 0, new Vector3f(425,10,175),new Vector3f(425,10,175));
		puzzle[100] = new PuzzleNode("swiptch4", 0, new Vector3f(425,10,225),new Vector3f(425,10,225));
		puzzle[101] = new PuzzleNode("switpch5", 1, new Vector3f(425,10,275),new Vector3f(425,10,275));
		puzzle[102] = new PuzzleNode("switcph6", 0, new Vector3f(425,10,325),new Vector3f(425,10,325));
		puzzle[103] = new PuzzleNode("switchp7", 1, new Vector3f(425,10,375),new Vector3f(425,10,375));
		puzzle[104] = new PuzzleNode("switch8p", 0, new Vector3f(425,10,425),new Vector3f(425,10,425));
		puzzle[105] = new PuzzleNode("swiptch9", 1, new Vector3f(425,10,475),new Vector3f(425,10,475));//*
		puzzle[106] = new PuzzleNode("spwitch10", 0, new Vector3f(425,10,525),new Vector3f(425,10,525));
		puzzle[107] = new PuzzleNode("swpitch11", 1, new Vector3f(425,10,575),new Vector3f(425,10,575));

		puzzle[108] = new PuzzleNode("swivtch0", 1, new Vector3f(475,10,25),new Vector3f(475,10,25));
		puzzle[109] = new PuzzleNode("switvch1", 0, new Vector3f(475,10,75),new Vector3f(475,10,75));
		puzzle[110] = new PuzzleNode("switcvh2", 1, new Vector3f(475,10,125),new Vector3f(475,10,125));
		puzzle[111] = new PuzzleNode("svwitch3", 0, new Vector3f(475,10,175),new Vector3f(475,10,175));
		puzzle[112] = new PuzzleNode("swvitch4", 1, new Vector3f(475,10,225),new Vector3f(475,10,225));
		puzzle[113] = new PuzzleNode("swivtch5", 1, new Vector3f(475,10,275),new Vector3f(475,10,275));
		puzzle[114] = new PuzzleNode("switvvch6", 0, new Vector3f(475,10,325),new Vector3f(475,10,325));
		puzzle[115] = new PuzzleNode("switchv7", 1, new Vector3f(475,10,375),new Vector3f(475,10,375));
		puzzle[116] = new PuzzleNode("swvitch8", 0, new Vector3f(475,10,425),new Vector3f(475,10,425));
		puzzle[117] = new PuzzleNode("swivtch9", 1, new Vector3f(475,10,475),new Vector3f(475,10,475));
		puzzle[118] = new PuzzleNode("switvch10", 0, new Vector3f(475,10,525),new Vector3f(475,10,525));
		puzzle[119] = new PuzzleNode("switcvh11", 1, new Vector3f(475,10,575),new Vector3f(475,10,575));

		puzzle[120] = new PuzzleNode("sfwitch0", 1, new Vector3f(525,10,25),new Vector3f(525,10,25));
		puzzle[121] = new PuzzleNode("swfitch1", 0, new Vector3f(525,10,75),new Vector3f(525,10,75));
		puzzle[122] = new PuzzleNode("swiftch2", 1, new Vector3f(525,10,125),new Vector3f(525,10,125));
		puzzle[123] = new PuzzleNode("switfch3", 0, new Vector3f(525,10,175),new Vector3f(525,10,175));
		puzzle[124] = new PuzzleNode("switcffh4", 1, new Vector3f(525,10,225),new Vector3f(525,10,225));
		puzzle[125] = new PuzzleNode("switch5", 0, new Vector3f(525,10,275),new Vector3f(525,10,275));
		puzzle[126] = new PuzzleNode("sfwitch6", 0, new Vector3f(525,10,325),new Vector3f(525,10,325));
		puzzle[127] = new PuzzleNode("swfitch7", 1, new Vector3f(525,10,375),new Vector3f(525,10,375));
		puzzle[128] = new PuzzleNode("swiftch8", 0, new Vector3f(525,10,425),new Vector3f(525,10,425));
		puzzle[129] = new PuzzleNode("switfch9", 1, new Vector3f(525,10,475),new Vector3f(525,10,475));
		puzzle[130] = new PuzzleNode("switcffh10", 0, new Vector3f(525,10,525),new Vector3f(525,10,525));
		puzzle[131] = new PuzzleNode("switch1f1", 1, new Vector3f(525,10,575),new Vector3f(525,10,575));

		puzzle[132] = new PuzzleNode("scwitch0", 1, new Vector3f(575,10,25),new Vector3f(575,10,25));
		puzzle[133] = new PuzzleNode("swcitch1", 1, new Vector3f(575,10,75),new Vector3f(575,10,75));
		puzzle[134] = new PuzzleNode("swictch2", 1, new Vector3f(575,10,125),new Vector3f(575,10,125));
		puzzle[135] = new PuzzleNode("switcch3", 1, new Vector3f(575,10,175),new Vector3f(575,10,175));
		puzzle[136] = new PuzzleNode("switcch4", 1, new Vector3f(575,10,225),new Vector3f(575,10,225));
		puzzle[137] = new PuzzleNode("switchcc5", 1, new Vector3f(575,10,275),new Vector3f(575,10,275));
		puzzle[138] = new PuzzleNode("cswitch6", 1, new Vector3f(575,10,325),new Vector3f(575,10,325));
		puzzle[139] = new PuzzleNode("scwitch7", 1, new Vector3f(575,10,375),new Vector3f(575,10,375));
		puzzle[140] = new PuzzleNode("swcitch8", 1, new Vector3f(575,10,425),new Vector3f(575,10,425));
		puzzle[141] = new PuzzleNode("swictch9", 1, new Vector3f(575,10,475),new Vector3f(575,10,475));
		puzzle[142] = new PuzzleNode("switcch10", 1, new Vector3f(572,10,525),new Vector3f(575,10,525));
		puzzle[143] = new PuzzleNode("switcch11", 1, new Vector3f(572,10,575),new Vector3f(575,10,575));
		
		for(int i =0; i < puzzle.length; i++)
		{
			this.attachChild(puzzle[i]);
		}
	}
	
	
	
	
}
